var templateParams = {
    tableTheads:["测试集名称", "测试用例", "创建时间","备注", "操作"]};

var columnsSetting = [ {
    "data":null,
    "render":function(data, type, full, meta){
        return checkboxHmtl(data.set_name, data.id, "selectCaseSet");
    }},
    {"data":"id"},
    ellipsisData("set_name"),
    {
        "data":"case_count",
        "render":function(data, type, full, meta){
            var context =
                [{
                    type:"default",
                    size:"M",
                    markClass:"show-set-case",
                    name:data || 0
                }];
            return btnTextTemplate(context);
        }
    },
    ellipsisData("create_time"),
    longTextData("mark", "set_name", "备注信息"),
    {
        "data":null,
        "render":function(data, type, full, meta){
            var context = [{
                title:"选择",
                markClass:"object-choose",
                iconFont:"&#xe6ab;"
            }];
            return btnIconTemplate(context);
        }
    }];

var eventList = {
    '.object-choose':function(){
        choosedCallBackFun(table.row( $(this).parents('tr') ).data());
        parent.layer.close(parent.layer.getFrameIndex(window.name));
    }
};
var choosedCallBackFun;//成功选择之后的回调函数
var mySetting = {
    eventList:eventList,
    templateCallBack:function(df){
        choosedCallBackFun = parent[GetQueryString("callback")];
        df.resolve();
    },
    listPage:{
        listUrl:REQUEST_URL.WEB_CASE_SET.listSet,
        tableObj:".table-sort",
        columnsSetting:columnsSetting,
        columnsJson:[0, 5, 6],
        dtOtherSetting:{
            serverSide:false
        },
        exportExcel:false
    },
    templateParams:templateParams
};

$(function(){
    publish.renderParams = $.extend(true,publish.renderParams,mySetting);
    publish.init();
});
